package com.SouthernWall_404.AgeSuitcase.Client.Gui.Screens;

import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.worldselection.SelectWorldScreen;
import net.minecraft.network.chat.Component;

public class OperateScreen extends Screen {

    public Button simgleButton;

    private int defaultStartX;
    private int defaultStartY;

    private int buttonLength=120;
    private int buttonHeight=20;

    public OperateScreen(Component p_96550_) {
        super(p_96550_);
    }

    @Override
    protected void init() {
        super.init();

        defaultStartX=this.width*2/3;
        defaultStartY=this.height/6;

        simgleButton= Button.builder(Component.literal("start"),b->this.minecraft.setScreen(new LoadingScreen(Component.empty(),new SelectWorldScreen(this),100))).build();
        simgleButton.setHeight(buttonHeight);
        simgleButton.setWidth(buttonLength);
        simgleButton.setPosition(defaultStartX,defaultStartY);

    }

    @Override
    public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float particialTick) {
        super.render(guiGraphics, mouseX, mouseY, particialTick);

        this.addRenderableWidget(simgleButton);

        this.renderBackground(guiGraphics);
    }

    @Override
    public void renderBackground(GuiGraphics p_283688_) {
        super.renderBackground(p_283688_);
    }
}
